xenpm, x86: Fix reporting of idle state average residency times
authorBoris Ostrovsky <boris.ostrovsky@amd.com>
Wed, 6 Jun 2012 15:34:53 +0000 (16:34 +0100)
committerBoris Ostrovsky <boris.ostrovsky@amd.com>
Wed, 6 Jun 2012 15:34:53 +0000 (16:34 +0100)
commitdb48465811a8d983a349d7b8a96c16f6adf942dc
tree4bf04732ef38011c3013bc4684dcd4643041a7f9
parentbf3ffa30a023fed127fa5cfc0d52f6844e244561
xenpm, x86: Fix reporting of idle state average residency times

If CPU stays in the same idle state for the full duration of
xenpm sample then average residency may not be reported correctly
since usage counter will not be incremented.

In addition, in order to calculate averages correctly residence
time and usage counter should be read and written atomically.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
tools/misc/xenpm.c
xen/arch/x86/acpi/cpu_idle.c
xen/include/xen/cpuidle.h